﻿using GameFramework.command;
using UnityEngine;

namespace Game.modules.player.input
{
    public class MoveCommand:ICommand
    {
        public Vector3 direction;
        public GameObject moveObj;
        public bool canExcute()
        {
            return true;
        }

        public void excute()
        {
            if (direction == null || moveObj==null)
            {
                return;
            }
            //方向单一画
            direction = direction.normalized;
            //TODO 获取移动物理的速度
            moveObj.transform.Translate(direction*Time.deltaTime);
        }
    }
}